//https://www.bilibili.com/video/BV1d54y1f7B3/?spm_id_from=333.337.search-card.all.click&vd_source=d6fe65f095f01f05591e89d810720ccc
// 2024-10-19

public class P015_排列硬币_暴力法 {

    public static void main(String[] args) {
        System.out.println(fun(20));
    }


    private static int fun(int n) {
        for (int i = 1; i <= n; i++) { //i 是第几行
            n = n - i;
            if (n <= i) return i;
        }
        return 0;
    }
}
